<?php

include("core/config/init.php");
include("core/includes/database/mysql.php");
include("core/includes/ffamax_config.php");
//error_reporting(-1);
//ini_set("display_errors", 1);
$far_1 = array("core/config/connect.inc.php"
,"core/config/language_list.php"
,"core/config/paths.inc.php"
,"core/classes/class.virtual.shippingratecalculator.php"
,"core/classes/class.virtual.paymentmodule.php"
,"core/classes/class.xmlnodex.php");

$far_2 = glob("core/functions/*.php"); 
$far_3 = glob("core/functions/admin/*.php");
$far = array_merge($far_1,$far_2,$far_3);
$cfar = count($far);
for ($n=0; $n<$cfar; $n++) include ($far[$n]);
db_connect(DB_HOST, DB_USER, DB_PASS) or die(ERROR_DB_INIT);
db_select_db(DB_NAME) or die(db_error());
settingDefineConstants();
  
require ("core/smarty/smarty.class.php");
$smarty = new Smarty; //core smarty object


require_once("ff/include/ClassExchangeRatesCBRF.php");
$rates = new ExchangeRatesCBRF(date("Y-m-d"));

$cur_rate = $rates->GetRate("USD");

if (($cur_rate > 25) AND ($cur_rate < 35)) {
	update_currency_xe_rate ($cur_rate);
}
else {
	echo 'EX USD rate is ' . $cur_rate . ' and this value declined by settings';
}
  
  
  

?>